package com.itheima.chapter07.time;

import java.time.LocalDateTime;

public class JDKdemo4 {
    public static void main(String[] args) {
        //增加或减少时间
        LocalDateTime localDateTime =LocalDateTime.of(2021,03,19,12,13,14);
        System.out.println("=========plus=========");
        LocalDateTime years = localDateTime.plusYears(3);
        System.out.println(years);
        LocalDateTime years1 = localDateTime.plusYears(-3);
        System.out.println(years1);
        System.out.println("=========minus=========");
        LocalDateTime months = localDateTime.minusMonths(06);
        System.out.println(months);
        LocalDateTime months1 = localDateTime.minusMonths(-01);
        System.out.println(months1);

    }
}
